package com.zhihao.takeaway.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhihao.takeaway.entity.ShoppingCart;
import com.zhihao.takeaway.entity.ShoppingCartMarketerVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    @Select("select shopping_cart.*,marketer.store_name as storeName from shopping_cart,marketer where marketer.id = shopping_cart.marketer_id and shopping_cart.user_id = #{userId}")
    List<ShoppingCartMarketerVo> selectShoppingCartMarketer(String userId);
}
